<template>
  <div>
    <ul class="mui-table-view">
      <li
        class="mui-table-view-cell mui-media"
        v-for="item in newlist"
        :key="item.image1"
      >
        <router-link :to="'/home/newlist/newinfo/' + item.type">
          <img class="mui-media-object mui-pull-left" :src="item.image1" />
          <div class="mui-media-body">
            <h2>{{ item.name }}</h2>
            <p class="mui-ellipsis">
              <span>{{ item.created_at }}</span>
              <span>点击:{{ item.type }}次</span>
            </p>
          </div>
        </router-link>
      </li>
    </ul>
  </div>
</template>

<script>
import { Toast } from "mint-ui";

export default {
  data() {
    return {
      newlist: [],
    };
  },

  created() {
    this.getnewlist();
  },
  methods: {
    getnewlist() {
      this.$http.get("https://www.apiopen.top/satinApi").then((res) => {
        if (res) {
          this.newlist = res.body.data;
          // console.log(this.newlist)
          console.log(res);
        } else {
          Toast("获取数据失败!");
        }
      });
    },
  },
};
</script>



<style lang="less" scoped>
.mui-table-view-cell {
  img {
    width: 45px;
    height: 45px;
  }
}

.mui-media-body {
  h2 {
    font-size: 14px;
  }
}
.mui-ellipsis {
  display: flex;
  justify-content: space-between;
  span {
    color: #2c0ce2;
  }
}
</style>
